package com.rinlink.jbcodec.creator;

import com.alibaba.fastjson.JSONObject;
import com.rinlink.jbcodec.common.MapUtils;
import com.rinlink.jbcodec.transform.Transform;

import java.util.List;

public abstract class NumberArrayToBytesCreator<T extends Number> extends ArrayToBytesCreator<T> {
    /*@Override
    protected Transform<byte[]> create(JSONArray ts, int size, JSONObject attr, JSONObject source) {
        String order = MapUtils.getOrDefault(attr,"order","big_engine");
        return create(list,size,order);
    }*/


    @Override
    protected Transform<byte[]> create(List<T> ts, JSONObject attr, JSONObject source) {
        String order = MapUtils.getOrDefault(attr,"order","big_engine");
        return create(ts,order);
    }

    protected abstract Transform<byte[]> create(List<T> ts,  String order);

}
